home *** CD-ROM | disk | FTP | other *** search
/ FishMarket 1.0 / FishMarket v1.0.iso / fishies / 351-375 / disk_359 / dice / dice.lzh / include / assert.h next >
C/C++ Source or Header  |  1990-02-20  |  441b  |  27 lines

  1.  
  2. /*
  3.  *  ASSERT.H
  4.  *
  5.  *  relatively optimized, takes advantage of GNU-cpp __BASE_FILE__ macro
  6.  *  allowing us to store the filename string once in a static decl.
  7.  */
  8.  
  9. #ifndef _ASSERT_H
  10. #define _ASSERT_H
  11.  
  12. static char *__BaseFile = __BASE_FILE__;
  13.  
  14. extern void __FailedAssert(char *, int);
  15.  
  16. #ifndef assert
  17. #ifdef NDEBUG
  18. #define assert(ignore)
  19. #else
  20. #define assert(exp)     if (exp) __FailedAssert( __BaseFile, __LINE__);
  21. #endif
  22. #endif
  23.  
  24. #endif
  25.  
  26.  
  27.